package com.example.leetcode.bit;

import com.example.leetcode.bit.common.BitUtils;

class Solution191 {
    // you need to treat n as an unsigned value
    public int hammingWeight(int n) {
//        return BitUtils.hammingWeight(n);
        return BitUtils.hammingWeight2(n);
    }
}

public class leetcode191 {
    public static void main(String[] args) {
        Solution191 solution191 = new Solution191();
        System.out.println(solution191.hammingWeight(0b00000000000000000000000000001011));
        System.out.println(solution191.hammingWeight(0b00000000000000000000000010000000));
        System.out.println(solution191.hammingWeight(0b11111111111111111111111111111101));
    }
}
